﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Shrestha.DataWizard
{
    /// <summary>
    /// Interaction logic for SelectSource.xaml
    /// </summary>
    public partial class SelectSource : Page
    {
        private SelectDb selectDb;
        private DataSourceLoader dataSourceLoader;

        public SelectSource(DataSourceLoader ds)
        {
            InitializeComponent();
            dataSourceLoader = ds;
            selectDb = new SelectDb(ds);
        }

        private void buttonNext_Click(object sender, RoutedEventArgs e)
        {
            string source = (comboBoxSource.SelectedItem as ComboBoxItem).Tag.ToString();
            Uri nextUri = new Uri("Select" + source + ".xaml", UriKind.Relative);
            this.NavigationService.Navigate(selectDb);
        }

        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
            dataSourceLoader.DataLoaded = false;
            dataSourceLoader.Close();
        }

    }
}
